-- GENERATED SPELL FOR [Conjurer Tyren] --


function spell0_18527(pUnit, Event) --@Blue Firework,Self--
pUnit:FullCastSpellOnTarget(11540,pUnit)
pUnit:RegisterEvent('Sorts_18527', 578, 1)
end

function spell1_18527(pUnit, Event) --@Evocation,Self--
pUnit:FullCastSpellOnTarget(12051,pUnit)
pUnit:RegisterEvent('Sorts_18527', 8000, 1)
end

function spell2_18527(pUnit, Event) --@Purple Firework,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(30161,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18527', 1, 1)
end

function spell3_18527(pUnit, Event) --@Red Streaks Firework,Self--
pUnit:FullCastSpellOnTarget(11542,pUnit)
pUnit:RegisterEvent('Sorts_18527', 538, 1)
end

function spell4_18527(pUnit, Event) --@Yellow Rose Firework,Self--
pUnit:FullCastSpellOnTarget(11544,pUnit)
pUnit:RegisterEvent('Sorts_18527', 597, 1)
end

function Sorts_18527(pUnit, Event)
local choix_sorts_18527 = math.random(0, 4)
if choix_sorts_18527 == 0 then
pUnit:RegisterEvent('spell0_18527', 1, 1)
end
if choix_sorts_18527 == 1 then
pUnit:RegisterEvent('spell1_18527', 1, 1)
end
if choix_sorts_18527 == 2 then
pUnit:RegisterEvent('spell2_18527', 1, 1)
end
if choix_sorts_18527 == 3 then
pUnit:RegisterEvent('spell3_18527', 1, 1)
end
if choix_sorts_18527 == 4 then
pUnit:RegisterEvent('spell4_18527', 1, 1)
end
end

function mob18527_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18527', math.random(1500, 3000), 1)
end

function mob18527_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18527_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18527_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18527, 1, 'mob18527_Action')
RegisterUnitEvent(18527, 2, 'mob18527_Leave')
RegisterUnitEvent(18527, 3, 'mob18527_Kill')
RegisterUnitEvent(18527, 4, 'mob18527_Die')
